using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ModelTools._Iterator
{
    /// <summary>
    /// <para>Iterate Row Selection</para>
    /// <para>Iterates over rows in a table.</para>
    /// <para>循环访问表中的行。</para>
    /// </summary>    
    [DisplayName("Iterate Row Selection")]
    public class IterateRowSelection : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public IterateRowSelection()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_table">
        /// <para>Input Table</para>
        /// <para>The table containing records to iterate through.</para>
        /// <para>包含要循环访问的记录的表。</para>
        /// </param>
        public IterateRowSelection(object _in_table)
        {
            this._in_table = _in_table;
        }
        public override string ToolboxName => "Model Tools";

        public override string ToolName => "Iterate Row Selection";

        public override string CallName => "mb.IterateRowSelection";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_table, _fields, _skip_nulls, _selection, _value];

        /// <summary>
        /// <para>Input Table</para>
        /// <para>The table containing records to iterate through.</para>
        /// <para>包含要循环访问的记录的表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_table { get; set; }


        /// <summary>
        /// <para>Group By Fields</para>
        /// <para>The input field or fields used to group the features for selection. Any number of input fields can be defined, resulting in a selection based on a unique combination of the fields. If a field is not specified, the Object ID is used to iterate over features.</para>
        /// <para>用于对要选择的要素进行分组的一个或多个输入字段。可以定义任意数量的输入字段，从而根据字段的唯一组合进行选择。如果未指定字段，则对象 ID 用于迭代要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Group By Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _fields { get; set; } = null;


        /// <summary>
        /// <para>Skip Null Values</para>
        /// <para><xdoc>
        ///   <para>Specifies if null values in the grouping fields are skipped during selection.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Skip through all the null values in the grouping fields during selection.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Include all the null values in the grouping fields during selection. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定在选择过程中是否跳过分组字段中的空值。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 在选择过程中跳过分组字段中的所有空值。</bullet_item><para/>
        ///     <bullet_item>未选中 - 在选择期间在分组字段中包括所有空值。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Skip Null Values")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _skip_nulls { get; set; } = null;


        /// <summary>
        /// <para>Selected Rows</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Selected Rows")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _selection { get; set; }


        /// <summary>
        /// <para>Value</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Value")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _value { get; set; }


        public IterateRowSelection SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}